﻿CREATE TABLE [dbo].[tc_optimization_visitor_visit]
(
    [id] UNIQUEIDENTIFIER NOT NULL, 
    [visitor_id] UNIQUEIDENTIFIER NOT NULL,
    [registered_user_id] UNIQUEIDENTIFIER,
    [category] NVARCHAR(2048) NOT NULL,
    [category_detail] NVARCHAR(2048),
    [url] NVARCHAR(2048) NOT NULL,
    [referer] NVARCHAR(2048),
    [agent] NVARCHAR(2048),
    [geolocation] NVARCHAR(2048),
    [language] NVARCHAR(2048),
    [platform] NVARCHAR(2048),
    [website_id] UNIQUEIDENTIFIER NOT NULL, 
    [website_created] DATETIMEOFFSET NOT NULL, 
    [website_created_by] NVARCHAR(64) NOT NULL, 
    [website_modified] DATETIMEOFFSET NOT NULL, 
    [website_modified_by] NVARCHAR(64) NOT NULL, 
    [created] DATETIMEOFFSET NOT NULL, 
    [created_by] NVARCHAR(64) NOT NULL, 
    [modified] DATETIMEOFFSET NOT NULL, 
    [modified_by] NVARCHAR(64) NOT NULL, 
    [row_version] TIMESTAMP NOT NULL, 
    CONSTRAINT [pk_tc_optimization_visitor_visit] PRIMARY KEY NONCLUSTERED ([id])
)

GO

CREATE CLUSTERED INDEX [uk_tc_optimization_visitor_visit_website_id] ON [dbo].[tc_optimization_visitor_visit] ([website_id])
